<%--
  Created by IntelliJ IDEA.
  rowingmanager.domain.User: simon
  Date: 13.6.2009
  Time: 5:03:06
  To change this template use File | Settings | File Templates.
--%>

<%@ page contentType="text/html;charset=UTF-8" %>
<html>
  <head><title>Simple GSP page</title>
  <meta name="layout" content="wider"/>
  <link rel="stylesheet" href="${createLinkTo(dir:'css',file:'register.css')}" />
  <g:javascript library="jquery"/>
  </head>
  <body>
    <g:form id="register-form"  method="POST" enctype="multipart/form-data" controller="organization" action="save">
			<fieldset>
                <div id="errors">
                  <g:hasErrors bean="${organization}">
                    <g:renderErrors bean="${organization}" as="list"/>
                  </g:hasErrors>
                  <g:if test="${flash?.message}">
                    ${flash.message}
                  </g:if>
                </div>
				<div id="step1">
                  <div class="legend">1.</div>
                  <h3>Enter your login details</h3>
                  <div class="info">
                      You will use email for your login
                  </div>
                  <div class="field">
                      <label for="email">Email: </label>
                      <input id="email" type="text" class="no-border" name="user.email" value="${user?.email}"/>
                    <g:hasErrors bean="${organization}" field="users.email">
                      <div class="error"> correct this field</div>
                    </g:hasErrors>
                  </div>
                  <div class="field">
                      <label for="email2">Retype email: </label>
                      <input id="email2" type="text" class="no-border" value="${user?.email}"/>
                      <!--<div class="error">*error will be here</div>  -->
                  </div>
                  <div class="field">
                      <label for="password">Password: </label>
                      <input id="password" type="password" class="no-border" name="user.password"/>
                       <!--<div class="error">*error will be here</div>  -->
                  </div>
                  <div class="field">
                      <label for="password2">Retype password: </label>
                      <input id="password2" type="password" class="no-border"/>
                      <!--<div class="error">*error will be here</div>  -->
                  </div>
               </div>
					     <div id="step2">
                 <div class="legend">2.</div>
                 <h3>Enter your organization details</h3>
                    <div class="info">
                        So who are you?
                    </div>
                    <div class="field">
                        <label for="title"> Title (name):</label>
                        <input id="title" type="text" class="no-border" name="organization.title" value="${organization.title}"/>
                       <!--<div class="error">*error will be here</div>  -->
                    </div>
                    <div class="field">
                        <label for="type">Organization type: </label>
                        <select id="type"  name="organization.type">
                            <option>rowing club</option>
                            <option>colleage</option>
                            <option>something else</option>
                        </select>
                     <!--<div class="error">*error will be here</div>  -->
                    </div>
                    <div class="field">
                        <label for="taxid">TAX id:</label>
                        <input id="taxid" type="text" class="no-border" name="organization.taxid" value="${organization.taxid}"/>
                       <!--<div class="error">*error will be here</div>  -->
                    </div>
                    <div class="field">
                        <label for="phone">Phone:</label>
                        <input id="phone" type="text" class="no-border" name="organization.phone" value="${organization.phone}"/>
                       <!--<div class="error">*error will be here</div>  -->
                    </div>
               </div>
					     <div id="step3">
                 <div class="legend">3.</div>
                 <h3>Enter your address details</h3>
                    <div class="info">
                        Where are you located?
                    </div>
                    <div class="field">
                        <label for="address">Address line 1: </label>
                        <input id="address" type="text" class="no-border" name="address.street" value="${organization?.address?.street}"/>
                        <!--<div class="error">*error will be here</div>  -->
                    </div>
                    <div class="field">
                        <label for="address2">Address line 2: </label>
                        <input id="address2" type="text" class="no-border" name="address.street2"/>
                        <!--<div class="error">*error will be here</div>  -->
                    </div>
                    <div class="field">
                        <label for="zip">Postal code: </label>
                        <input id="zip" type="text" class="no-border" name="address.postalCode" value="${organization?.address?.postalCode}"/>
                        <!--<div class="error">*error will be here</div>  -->
                    </div>
                    <div class="field">
                        <label for="city">City: </label>
                        <input id="city" type="text" class="no-border" name="address.city" value="${organization?.address?.city}"/>
                        <!--<div class="error">*error will be here</div>  -->
                    </div>
                    <div class="field">
                        <label for="state">State: </label>
                        <input id="state" type="text" class="no-border" name="address.state" value="${organization?.address?.state}"/>
                       <!--<div class="error">*error will be here</div>  -->
                    </div>
                    <div class="field">
                        <label for="country">Country: </label>
                        <g:select id="country" name="address.country"  from="${clist}" optionKey="id"/>
                        <!--<div class="error">*error will be here</div>  -->
                    </div>
               </div>
               <div id="step4">
                 <div class="legend">4.</div>
                 <h3>Logo</h3>
                    <div class="info">
                        You're almost done
                    </div>
                    <div class="field">
                        <label for="logo">Your logo: </label>
                        <input id="logo" type="file"  name="logo"/>
                    </div>
                    <div class="info">Answer this simple question</div>
                    <div>
                        <g:if test="${flash?.captcha}">
                          <div class="error"> ${flash.captcha}</div>
                        </g:if>
                        <label for="captcha">${session?.captcha} = </label>
                        <g:remoteField class="captcha"  name="captchaValue" update="response" paramName="captchaValue" action="checkCaptcha"/><div id="response"></div>
                    </div>
                    <div class="info">Finally, choose your destiny</div>
                    <g:submitButton value="Register" name="regBtn"/>

               </div>
               </fieldset>

		</g:form>
  </body>
</html>